import request from '@/utils/request'

//试卷-根据 考核/作业/练习Id 获取试卷
export function getPaperByPaperIdApi(paperId) {
  return request({
    url: `/exam/teacher/paper/getPaperByExamId/${paperId}`,
    method: 'get'
  })
}

//试卷-考试专用课程目录
export function getCourseIndexTreesApi(courseId) {
  return request({
    url: `/exam/teacher/topic/selectIndexIds/${courseId}`,
    method: 'get'
  })
}

//试卷-新增大题
export function addPaperTitleApi(data) {
  return request({
    url: `/exam/teacher/paper/addTitle`,
    method: 'post',
    data: data
  })
}

//试卷-修改大题
export function editTitleApi(data) {
  return request({
    url: `/exam/teacher/paper/editTitle`,
    method: 'put',
    data: data
  })
}

//试卷-删除大题
export function removeTitleApi(titleId) {
  return request({
    url: `/exam/teacher/paper/removeTitle/${titleId}`,
    method: 'delete'
  })
}

//试卷-更改大题排序
export function changeTitleSortApi(titleIds) {
  return request({
    url: `/exam/teacher/paper/changeTitleSort/${titleIds}`,
    method: 'put'
  })
}

//试卷-固定大题-新增试题
export function addConnmonTopicApi(titleId, data) {
  return request({
    url: `/exam/teacher/fixationPaper/addTopic/${titleId}`,
    method: 'post',
    data: data
  })
}

//试卷-固定大题-删除试题
export function deleteConnmonTopicApi(paperTopicId, titleId) {
  return request({
    url: `/exam/teacher/fixationPaper/removePaperTopic/${paperTopicId}/${titleId}`,
    method: 'delete'
  })
}

//试卷-固定大题-从题库中选择试题
export function addConnmonTopicByBankApi(titleId, topicIds) {
  return request({
    url: `/exam/teacher/fixationPaper/choiceTopic/${titleId}/${topicIds}`,
    method: 'post'
  })
}

//试卷-固定大题-更改试题排序
export function changeFixedTopicSortApi(topicIds) {
  return request({
    url: `/exam//teacher/fixationPaper/changeTopicSort/${topicIds}`,
    method: 'put'
  })
}

//试卷-容器大题-添加抽题容器
export function addContainerApi(examId, titleId) {
  return request({
    url: `/exam/teacher/containerPaper/createContainer/${examId}/${titleId}`,
    method: 'post'
  })
}

//试卷-容器大题-新增试题
export function addContainerTopicApi(containerId, data) {
  return request({
    url: `/exam/teacher/containerPaper/addTopic/${containerId}`,
    method: 'post',
    data: data
  })
}

//试卷-容器大题-从题库中选择试题
export function addContainerTopicByBankApi(containerId, topicIds) {
  return request({
    url: `/exam/teacher/containerPaper/choiceTopic/${containerId}/${topicIds}`,
    method: 'post'
  })
}

//试卷-容器大题-删除抽题容器
export function removeContainerApi(containerId) {
  return request({
    url: `/exam/teacher/containerPaper/removeContainer/${containerId}`,
    method: 'post'
  })
}

//试卷-容器大题-修改题目数量
export function updateContainerNumApi(data) {
  return request({
    url: `/exam/teacher/containerPaper/updateContainerUnlimitedNum`,
    method: 'post',
    data:data
  })
}

//试卷-容器大题-删除抽题容器中的题目
export function removeContainerTopicApi(containerId, topicIds) {
  return request({
    url: `/exam/teacher/containerPaper/removeContainerTopic/${containerId}/${topicIds}`,
    method: 'post'
  })
}

//试卷-容器大题-根据容器id获取容器信息
export function getContainerByIdApi(containerId) {
  return request({
    url: `/exam/teacher/containerPaper/getContainerById/${containerId}`,
    method: 'get'
  })
}

//试卷-容器大题-获取抽题容器中的题目
export function getContainerTopicListApi(containerId,params) {
  return request({
    url: `/exam/teacher/containerPaper/getContainerTopic/${containerId}`,
    method: 'get',
    params:params
  })
}

//试卷-随机大题-新增随机大题策略
export function addTacticsApi(examId,titleId) {
  return request({
    url: `/exam/teacher/randomPaper/addTactics/${examId}/${titleId}`,
    method: 'post',
  })
}

//试卷-随机大题-修改随机策略题目数量
export function updateTacticsNumApi(data) {
  return request({
    url: `/exam/teacher/randomPaper/updateTacticsNum`,
    method: 'post',
    data: data
  })
}

//试卷-随机大题-删除随机大题策略
export function removeTacticsApi(tacticsId) {
  return request({
    url: `/exam/teacher/randomPaper/removeTactics/${tacticsId}`,
    method: 'post'
  })
}

//试卷-随机大题-根据大题Id获取策略信息
export function getTacticsByIdApi(tacticsId) {
  return request({
    url: `/exam/teacher/randomPaper/getTacticsByTitleId/${tacticsId}`,
    method: 'get'
  })
}

//试卷-随机大题-更新随机策略信息
export function updateTacticsInfoApi(tacticsId,indexId,topicType) {
  return request({
    url: `/exam/teacher/randomPaper/updateTacticsInfo/${tacticsId}/${indexId}/${topicType}`,
    method: 'post'
  })
}

//试卷-随机大题-获取分类下的试题列表信息
export function getTacticsInfoApi(topicType,indexId,data) {
  return request({
    url: `/exam/teacher/randomPaper/getTacticsInfo/${topicType}/${indexId}`,
    method: 'post',
    data: data
  })
}

//试题-题库-公共获取详细信息
export function getTopicInfoApi(id) {
  return request({
    url: `/exam/teacher/topic/info/${id}`,
    method: 'get'
  })
}
//试题-题库-公共添加
export function addTopicApi(data) {
  return request({
    url: `/exam/teacher/topic/add`,
    method: 'post',
    data:data
  })
}

//试题-题库-公共修改
export function editTopicApi(data) {
  return request({
    url: `/exam/teacher/topic/update`,
    method: 'put',
    data: data
  })
}

//试题-题库-公共删除
export function deleteTopicApi(ids) {
  return request({
    url: `/exam/teacher/topic/delete/${ids}`,
    method: 'delete'
  })
}


//试题-批量删除
export function deleteBatchApi(paperId,data) {
  return request({
    url: `/exam/teacher/paper/deleteBatch/${paperId}`,
    method: 'put',
    data: data
  })
}


//试题-批量修改所有题目配分
export function updateBatchScoreApi(paperId,data) {
  return request({
    url: `/exam/teacher/paper/updateBatchScore/${paperId}`,
    method: 'put',
    data: data
  })
}

//试题-考试-修改
export function updateExamInfoApi(data) {
  return request({
    url: `/exam/teacher/manager`,
    method: 'put',
    data: data
  })
}

//试题-题库-查询列表
export function getBankTopicLickApi(params) {
  return request({
    url: `/exam/teacher/topic/list`,
    method: 'get',
    params: params
  })
}

//试题-更改发布状态
export function updatePublishStateApi(examld,params) {
  return request({
    url: `/exam/teacher/manager/updatePublish/${examld}`,
    method: 'get',
    params: params
  })
}
//试题-查询考试配置详细
export function getExamPaperInfoApi(id) {
  return request({
    url: `/exam/teacher/manager/${id}`,
    method: 'get'
  })
}
// 试卷-下载试卷
export function exportExamPaperApi(data) {
  return request({
    url: `/exam/teacher/manager/exportExamPaper`,
    method: 'post',
    responseType:"blob",
    data
  })
}

// 试题-导入列表验证
export function importValidate(data) {
  return request({
    url: 'exam/teacher/topic/importValidate',
    method: 'post',
    data: data
  })
}
